19. Documentation

Which of the following statements about in-line comments are true?

SOLUTION:
  • Comments are useful for clarifying complex code
  • Readable code is preferable over having comments to make your code readable

Which of the following statements about docstrings are true?

SOLUTION:
  • Docstrings explain the purpose of a function or module
  • You can add whatever details you want in a docstring